package com.battery.system.domain;

import com.battery.common.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import tk.mybatis.mapper.annotation.KeySql;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 商户对象 ws_merchant
 *
 * @author battery
 * @date 2021-01-22
 */
@Table(name = "ws_merchant")
public class Merchant {

    private static final long serialVersionUID = 1L;

    /**
     *
     */
    @Id
    @KeySql(useGeneratedKeys = true)
    private String id;

    /**
     * 商户编号
     */
    @Excel(name = "商户编号")
    private String code;

    /**
     * 主体  0 个人  1 企业
     */
    @Excel(name = "主体  0 个人  1 企业")
    private Integer subjectType;

    /**
     * 姓名
     */
    @Excel(name = "姓名")
    private String fullName;

    /**
     * 联系方式（为登录账户）
     */
    @Excel(name = "联系方式", readConverterExp = "为=登录账户")
    private String phone;

    /**
     * 分成比例
     */
    @Excel(name = "分成比例")
    private BigDecimal shareRatio;

    /**
     * 签约时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "签约时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date signingTime;

    /**
     * 平台ID
     */
    @Excel(name = "平台ID")
    private String projectId;

    /**
     * 直营合作商ID
     */
    @Excel(name = "直营合作商ID")
    private String partnerId;

    /**
     * 可提现金额
     */
    @Excel(name = "可提现金额")
    private BigDecimal cashoutMoney;

    /**
     * 已冻结金额
     */
    @Excel(name = "已冻结金额")
    private BigDecimal frozenMoney;

    /**
     * 备注
     */
    @Excel(name = "备注")
    private String remarks;

    /**
     * 是否删除
     */
    @Excel(name = "是否删除")
    private Integer isDelete;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    private BigDecimal totalRevenue;


    /**
     * 预付费
     */
    private BigDecimal preCost;


    @Transient
    private String positive;

    @Transient
    private String otherSide;

    @Transient
    private int deatilAbility;


    private Integer isPre;


    public Integer getIsPre() {
        return isPre;
    }

    public void setIsPre(Integer isPre) {
        this.isPre = isPre;
    }

    public BigDecimal getPreCost() {
        return preCost;
    }

    public void setPreCost(BigDecimal preCost) {
        this.preCost = preCost;
    }

    public String getPositive() {
        return positive;
    }

    public void setPositive(String positive) {
        this.positive = positive;
    }

    public String getOtherSide() {
        return otherSide;
    }

    public void setOtherSide(String otherSide) {
        this.otherSide = otherSide;
    }

    public int getDeatilAbility() {
        return deatilAbility;
    }

    public void setDeatilAbility(int deatilAbility) {
        this.deatilAbility = deatilAbility;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getCode() {
        return code;
    }

    public void setSubjectType(Integer subjectType) {
        this.subjectType = subjectType;
    }

    public Integer getSubjectType() {
        return subjectType;
    }

    public void setFullName(String fullName) {
        this.fullName = fullName;
    }

    public String getFullName() {
        return fullName;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getPhone() {
        return phone;
    }

    public void setShareRatio(BigDecimal shareRatio) {
        this.shareRatio = shareRatio;
    }

    public BigDecimal getShareRatio() {
        return shareRatio;
    }

    public void setSigningTime(Date signingTime) {
        this.signingTime = signingTime;
    }

    public Date getSigningTime() {
        return signingTime;
    }

    public void setProjectId(String projectId) {
        this.projectId = projectId;
    }

    public String getProjectId() {
        return projectId;
    }

    public void setPartnerId(String partnerId) {
        this.partnerId = partnerId;
    }

    public String getPartnerId() {
        return partnerId;
    }

    public void setCashoutMoney(BigDecimal cashoutMoney) {
        this.cashoutMoney = cashoutMoney;
    }

    public BigDecimal getCashoutMoney() {
        return cashoutMoney;
    }

    public void setFrozenMoney(BigDecimal frozenMoney) {
        this.frozenMoney = frozenMoney;
    }

    public BigDecimal getFrozenMoney() {
        return frozenMoney;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    public String getRemarks() {
        return remarks;
    }

    public void setIsDelete(Integer isDelete) {
        this.isDelete = isDelete;
    }

    public Integer getIsDelete() {
        return isDelete;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }


    public BigDecimal getTotalRevenue() {
        return totalRevenue;
    }

    public void setTotalRevenue(BigDecimal totalRevenue) {
        this.totalRevenue = totalRevenue;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("code", getCode())
                .append("subjectType", getSubjectType())
                .append("fullName", getFullName())
                .append("phone", getPhone())
                .append("shareRatio", getShareRatio())
                .append("signingTime", getSigningTime())
                .append("projectId", getProjectId())
                .append("partnerId", getPartnerId())
                .append("cashoutMoney", getCashoutMoney())
                .append("frozenMoney", getFrozenMoney())
                .append("updateTime", getUpdateTime())
                .append("remarks", getRemarks())
                .append("isDelete", getIsDelete())
                .toString();
    }
}
